using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BbqPortal.Web.UI;

namespace BbqPortal.Website
{
    public class PageBase : Page
    {
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            JSActionHelper.RegisterExternalScript(this, "Common.js", this.ResolveUrl("~/js/Common.js"));
            JSActionHelper.RegisterCommon(this);
        }

        private string _imageRootPath = null;
        protected string ImageRootPath
        {
            get
            {
                if (_imageRootPath == null) _imageRootPath = this.ResolveUrl(string.Concat("~/App_Themes/", this.Theme, "/"));
                return _imageRootPath;
            }
        }

        protected string MakeFriendlyPath(string module, string query)
        {
            return string.Concat(this.ResolveUrl("./"), module, "/", query, "/Default.aspx");
        }

        protected string MakeFriendlyPath(object query)
        {
            return string.Concat(this.ResolveUrl("./"), query, "/Default.aspx");
        }

    }
}
